package com.ls.blog.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ls.blog.dto.ArticleDTO;
import com.ls.blog.entity.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ls.blog.vo.ArticleVO;
import com.ls.blog.vo.PageVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lishun
 * @since 2022-01-14
 */
public interface ArticleMapper extends BaseMapper<Article> {

    //根据id查找博客
    ArticleDTO getByBlogId(@Param("id") String id);


    List<ArticleDTO> getArticleList(@Param("pageVO") PageVO pageVO);

    List<ArticleDTO>listArticleDTO(PageVO translate);

    /**
     * 后台根据分类id查找文章列表
     * @param articleVO
     * @return
     */
    IPage<ArticleDTO> getArticleListByCategoryId(Page<ArticleDTO> page, @Param("articleVO") ArticleVO articleVO);

    /**
     *
     * @return
     */
    List<ArticleDTO> news(@Param("nums") Integer nums);

    void top(Integer id);
}
